<?php
/* ******************************************************************
Items below here are accessed through the Database
****************************************************************** */

//SELECT THE CONFIG ITEMS

$sql = "SELECT * FROM ".DB_PREFIX."config";

if ($result = ba_db_query ($link, $sql)) {

	if (ba_db_num_rows($result) == 1)
	{
		$row = ba_db_fetch_assoc ($result);

		//DEFINE THEM
		define ('LOGIN_TIMEOUT', $row['cnLOGIN_TIMEOUT']);
		define ('LOGIN_TRIES', $row['cnLOGIN_TRIES']);
		define ('MIN_PASS_LEN', $row['cnMIN_PASS_LEN']);
		define ('SEND_PASSWORD', $row['cnSEND_PASSWORD']);
		define ('PLAYER_SPACES', (int) $row['cnPLAYER_SPACES']);
		define ('MONSTER_SPACES', (int) $row['cnMONSTER_SPACES']);
		define ('STAFF_SPACES', (int) $row['cnSTAFF_SPACES']);
		define ('TOTAL_SPACES', (int) $row['cnTOTAL_SPACES']);
		define ('PLAYER_BUNKS', (int) $row['cnPLAYER_BUNKS']);
		define ('MONSTER_BUNKS', (int) $row['cnMONSTER_BUNKS']);
		define ('STAFF_BUNKS', (int) $row['cnSTAFF_BUNKS']);
		define ('TOTAL_BUNKS', (int) $row['cnTOTAL_BUNKS']);
		define ('ANNOUNCEMENT_MESSAGE', $row['cnANNOUNCEMENT_MESSAGE']);
		define ('DISCLAIMER_TEXT', $row['cnDISCLAIMER_TEXT']);
		define ('EVENT_CONTACT_NAME', $row['cnEVENT_CONTACT_NAME']);
		define ('EVENT_CONTACT_MAIL', $row['cnEVENT_CONTACT_MAIL']);
		define ('TECH_CONTACT_NAME', $row['cnTECH_CONTACT_NAME']);
		define ('TECH_CONTACT_MAIL', $row['cnTECH_CONTACT_MAIL']);
		define ('TITLE', $row['cnTITLE']);
		define ('EVENT_NAME', stripslashes ($row['cnEVENT_NAME']));
		define ('SYSTEM_NAME', $row['cnSYSTEM_NAME']);
		define ('BOOKING_FORM_FILE_NAME', $row['cnBOOKING_FORM_FILE_NAME']);
		define ('BOOKING_LIST_IF_LOGGED_IN', $row['cnBOOKING_LIST_IF_LOGGED_IN']);
		define ('ALLOW_MONSTER_BOOKINGS', $row['cnALLOW_MONSTER_BOOKINGS']);
		define ('LOCATIONS_LABEL', $row['cnLOCATIONS_LABEL']);
		define ('LIST_GROUPS_LABEL', $row['cnLIST_GROUPS_LABEL']);
		define ('ANCESTOR_DROPDOWN', $row['cnANCESTOR_DROPDOWN']);
		define ('DEFAULT_FACTION', $row['cnDEFAULT_FACTION']);
		define ('NON_DEFAULT_FACTION_NOTES', $row['cnNON_DEFAULT_FACTION_NOTES']);
		define ('IC_NOTES_TEXT', $row['cnIC_NOTES_TEXT']);
		define ('USE_PAY_PAL', (bool) $row['cnUSE_PAY_PAL']);
		define ('PAYPAL_EMAIL', $row['cnPAYPAL_EMAIL']);
		define ('PAYPAL_PLAYER_1', stripslashes ($row['cnPAYPAL_PLAYER_1']));
		define ('PAYPAL_PLAYER_2', stripslashes ($row['cnPAYPAL_PLAYER_2']));
		define ('PAYPAL_PLAYER_3', stripslashes ($row['cnPAYPAL_PLAYER_3']));
		define ('PAYPAL_PLAYER_4', stripslashes ($row['cnPAYPAL_PLAYER_4']));
		define ('PAYPAL_MONSTER_1', stripslashes ($row['cnPAYPAL_MONSTER_1']));
		define ('PAYPAL_MONSTER_2', stripslashes ($row['cnPAYPAL_MONSTER_2']));
		define ('PAYPAL_MONSTER_3', stripslashes ($row['cnPAYPAL_MONSTER_3']));
		define ('PAYPAL_MONSTER_4', stripslashes ($row['cnPAYPAL_MONSTER_4']));
		define ('PAYPAL_STAFF_1', stripslashes ($row['cnPAYPAL_STAFF_1']));
		define ('PAYPAL_STAFF_2', stripslashes ($row['cnPAYPAL_STAFF_2']));
		define ('PAYPAL_STAFF_3', stripslashes ($row['cnPAYPAL_STAFF_3']));
		define ('PAYPAL_STAFF_4', stripslashes ($row['cnPAYPAL_STAFF_4']));
		define ('PAYPAL_AMOUNT_P1', $row['cnPAYPAL_AMOUNT_P1']);
		define ('PAYPAL_AMOUNT_P2', $row['cnPAYPAL_AMOUNT_P2']);
		define ('PAYPAL_AMOUNT_P3', $row['cnPAYPAL_AMOUNT_P3']);
		define ('PAYPAL_AMOUNT_P4', $row['cnPAYPAL_AMOUNT_P4']);
		define ('PAYPAL_AMOUNT_M1', $row['cnPAYPAL_AMOUNT_M1']);
		define ('PAYPAL_AMOUNT_M2', $row['cnPAYPAL_AMOUNT_M2']);
		define ('PAYPAL_AMOUNT_M3', $row['cnPAYPAL_AMOUNT_M3']);
		define ('PAYPAL_AMOUNT_M4', $row['cnPAYPAL_AMOUNT_M4']);
		define ('PAYPAL_AMOUNT_S1', $row['cnPAYPAL_AMOUNT_S1']);
		define ('PAYPAL_AMOUNT_S2', $row['cnPAYPAL_AMOUNT_S2']);
		define ('PAYPAL_AMOUNT_S3', $row['cnPAYPAL_AMOUNT_S3']);
		define ('PAYPAL_AMOUNT_S4', $row['cnPAYPAL_AMOUNT_S4']);
		define ('NPC_LABEL', $row['cnNPC_LABEL']);
		define ('PAYPAL_AUTO_MARK_PAID', $row['cnPAYPAL_AUTO_MARK_PAID']);
		define ('AUTO_ASSIGN_BUNKS', $row['cnAUTO_ASSIGN_BUNKS']);
		define ('USE_SHORT_OS_NAMES', $row['cnUSE_SHORT_OS_NAMES']);
		define ('USE_QUEUE', $row['cnUSE_QUEUE']);
	}
}

?>
